package com.henry.chatkit.conversation

import java.io.Serializable

class ConversationInfo : Serializable, Comparable<ConversationInfo> {

    enum class ConversationMode {
        WeChat, QQ
    }

    // 会话模式
    var mode = ConversationMode.WeChat
    // 会话类型
    var type: String = ""
    // 会话标识，C2C为对方用户ID，群聊为群组ID
    var id: String? = null
    // 会话ID
    var conversationId: String? = null
    // 是否为群会话
    var isGroup = false
    // 消息未读数
    var unRead = 0
    // 是否为置顶会话
    var top = false
    // 会话头像
    var icon: String? = null
    // 会话头像url
    var iconUrlList: List<Any>? = null

    // 会话标题
    var title: String? = null
    // 最后一条消息时间
    var lastMessageTime: Long = 0
    // 最后一天消息显示
    var lastMessageDisplay: String = ""
    // 会话界面显示的@提示消息
    var atInfoText: String? = null

    override fun compareTo(other: ConversationInfo): Int {
        return if (this.lastMessageTime > other.lastMessageTime) {
            -1
        } else if (this.lastMessageTime == other.lastMessageTime) {
            0
        } else {
            1
        }
    }

}